/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package shoppos;

/**
 *
 * @author Amin Ali
 */
public class Discount {

    private int ruleID;
    private int discountType;
    private float percentage;
    private int buyX;
    private int getY;

    public Discount(int ruleID, int discountType, float percentage, int buyX, int getY) {
        this.ruleID = ruleID;
        this.discountType = discountType;
        this.percentage = percentage;
        this.buyX = buyX;
        this.getY = getY;
    }

    public int getBuyX() {
        return buyX;
    }

    public void setBuyX(int buyX) {
        this.buyX = buyX;
    }

    public int getDiscountType() {
        return discountType;
    }

    public void setDiscountType(int discountType) {
        this.discountType = discountType;
    }

    public int getGetY() {
        return getY;
    }

    public void setGetY(int getY) {
        this.getY = getY;
    }

    public float getPercentage() {
        return percentage;
    }

    public void setPercentage(float  percentage) {
        this.percentage = percentage;
    }

    public int getRuleID() {
        return ruleID;
    }

    public void setRuleID(int ruleID) {
        this.ruleID = ruleID;
    }

    @Override
    public String toString() {
        if (discountType == 0) {
            return "Get " + percentage + "% off";
        } else {
            return "Buy " + buyX + "Get" + getY + "Free";
        }
    }
}
